<template>
  <div class="dynamicBox">
    <div class="d-box" v-for="item in res.status" :key="item.id">
      <div class="d-info">
        <img :src="`https://ss.lanqb.com/${item.profile.avatar}`" alt="" />
        <p class="d-name">{{ item.profile.nickname }}</p>
      </div>
      <p class="con">{{ item.content }}</p>
      <div class="display">
        <img :src="`https://ss.lanqb.com/${item.works.url}`" alt="" />
      </div>
      <div class="tags">{{ item.tags[0] }}</div>
      <div class="icon">
        <div class="check">
          <van-icon name="eye-o" />
          <p class="nums">{{ item.statistics.hits_num }}</p>
        </div>
        <div class="check">
          <van-icon name="chat-o" />
          <p class="nums">{{ item.statistics.comment_num }}</p>
        </div>
        <div class="check">
          <van-icon name="like-o" />
          <p class="nums">{{ item.statistics.like_num }}</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { getCurrentInstance, reactive } from "vue";
const { $axios, $request } =
  getCurrentInstance().appContext.config.globalProperties;

let res = reactive({
  status: [],
});

// https://m.lanqb.com/api/works?type=1,4&is_commun_status=0&page=1

$axios(`/lanqb/api/works?type=1,4&is_commun_status=0&page=1`, "GET").then(
  ({ data }) => {
    res.status = data.data;
    // console.log(res.status);
  }
);
</script>

<style lang="less">
* {
  margin: 0;
  padding: 0;
}
.dynamicBox {
  width: 100vw;
  height: calc(100vh - 40px - 44px - 42px - 50px);
  overflow-y: scroll;
  padding: 0 15px;
  box-sizing: border-box;
  &::-webkit-scrollbar {
    display: none;
  }
  .d-box {
    padding: 20px 0;
    border-bottom: 2px solid #eee;
    .d-info {
      display: flex;
      align-items: center;
      img {
        width: 32px;
        height: 32px;
        border-radius: 50%;
      }
      .d-name {
        font-size: 15px;
        color: #000000;
        margin-left: 10px;
      }
    }
    .con {
      margin-top: 10px;
      font-size: 15px;
      columns: #3f4345;
    }
    .display {
      margin-top: 10px;
      height: 400px;
      img {
        max-width: 300px;
        height: 100%;
        border-radius: 10px;
      }
    }
    .tags {
      margin-top: 10px;
      min-width: 54px;
      width: 100px;
      border-radius: 10px;
      color: #5b6164;
      font-size: 12px;
      background-color: #f7f7f7;
      line-height: 24px;
      text-align: center;
    }
    .icon {
      margin-top: 10px;
      display: flex;
      justify-content: space-between;
      padding: 0 25px;
      .check {
        display: flex;
        color: #5b6164;
        font-size: 14px;
        .nums {
          margin-left: 10px;
        }
      }
    }
  }
}
</style>
